<template>
  <view class="bg-white">
    <scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y"
                 @scrolltolower="lower" >
      <uni-card :cover="wikiDetail.imageUrl">
        <text class="uni-body">{{wikiDetail.name}}</text>
      </uni-card>

      <uni-section title="植物详情" class="" type="line"></uni-section>
      <view class="padding-left-sm padding-right-sm padding-bottom-sm">
    {{wikiDetail.description}}
      </view>
    </scroll-view>
  </view>
</template>

<script>
import {getWikiDetail} from "../../../api/flower/wiki";

export default {
  name: "forumDetil",
  data() {
    return {
      cover: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg',
      scrollTop: 0,
      value:"",
      wikiId:null,
      wikiDetail:{}
    }
  },
  //生命周期函数
  mounted() {
    //this.getList()
    this.getWikiDetail();


  },
  methods: {
    lower: function(e) {
      console.log(e)
    },
    onClick(e) {
      console.log(e)
    },
    input(e) {
      console.log('输入内容：', e);
    },
    onsubmit(){


    },
    //根据id查看详情的接口
    getWikiDetail(){
      let that =this;

      //wikiId 从缓存中取出来
      //wikiId缓存起来
      let wikiId = uni.getStorageSync('wikiId');
      this.wikiId = wikiId;
      getWikiDetail({
        id:wikiId
      }).then(res=>{
        console.log(res);
        that.wikiDetail = res.data;
      })
    },
  }
}
</script>

<style lang="less" scoped>


</style>